#include "pch.h"
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

class Solution {
public:
	int strStr(string haystack, string needle) {
		int len1 = haystack.length();
		int len2 = needle.length();
		if (!len2) 
			return 0;
		else if (!len1) 
			return -1;

		int res = -1;
		auto it= search(haystack.begin(),haystack.end(),needle.begin(),needle.end());
		if (it != haystack.end())
		{
			res = it - haystack.begin();
		}
		cout << res << endl;

		return res;
	}
};

int main()
{
	string str1 = "hello";
	string str2 = "la";

	Solution s;

	int res = s.strStr(str1,str2);

	return 0;
}